package javaApi.deleteFile;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;

import java.io.IOException;
import java.net.URI;

public class HadoopDeleteFile {
    public static void main(String[] args) throws IOException {
        String uri = args[0];
        Configuration conf = new Configuration();
        FileSystem fs = FileSystem.get(URI.create(uri), conf);
        Path delef = new Path("/user/niit/willDel");
        boolean delResult = fs.delete(delef, false);
        System.out.println(delResult == true ? "删除成功" : "删除失败");

    }
}
